package com.example.beans;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;

public class User {
     
	  private String name;
	  
	  @Max(value=60,message="年龄不得超过60")
	  @Min(value=18,message="未满18岁")
	  private int age;
	  
	  

	public User() {
		super();
	}


	public User(String name, int age) {
		super();
		this.name = name;
		this.age = age;
	}


	public String getName() {
		return name;
	}
	

	public void setName(String name) {
		this.name = name;
	}
	

	public int getAge() {
		return age;
	}
	

	public void setAge(int age) {
		this.age = age;
	}


	@Override
	public String toString() {
		return "User [name=" + name + ", age=" + age + "]";
	}
	
	  
	  
}
